<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>AmpleHarvest: cTABLE_Saved_Queries.php Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">AmpleHarvest
   &#160;<span id="projectnumber">0.0.1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('c_t_a_b_l_e___saved___queries_8php.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">cTABLE_Saved_Queries.php</div>  </div>
</div>
<div class="contents">
<a href="c_t_a_b_l_e___saved___queries_8php.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?php
<a name="l00005"></a>00005         use\ampleharvest\code;
<a name="l00006"></a>00006         require_once dirname(dirname(dirname(__FILE__))) . <span class="stringliteral">&#39;/config/cConfig.php&#39;</span>;
<a name="l00010"></a>00010         require_once code\cConfig::C_STR_DATABASE_LIB_PATH . <span class="stringliteral">&quot;/Classes/cTable.php&quot;</span>;
<a name="l00014"></a>00014         require_once code\cConfig::C_STR_DATABASE_LIB_PATH . <span class="stringliteral">&quot;/Classes/ColTypes.php&quot;</span>;
<a name="l00028"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html">00028</a>         <span class="keyword">class </span><a class="code" href="classc_t_a_b_l_e___saved___queries.html" title="Includes the base class for Tables (uses base path from the cinfo file.">cTABLE_Saved_Queries</a> <span class="keyword">extends</span> cTable
<a name="l00029"></a>00029         {
<a name="l00030"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#aa7fe491587f118f1d2d5f3bb8668356a">00030</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#aa7fe491587f118f1d2d5f3bb8668356a">C_INT_MAX_RESULTS_RETURNED</a> = 500;
<a name="l00031"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#ab13a06e00c9892ff6412025b610d194b">00031</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#ab13a06e00c9892ff6412025b610d194b">C_INT_DEFAULT_RESULTS_RETURNED</a> = 100;
<a name="l00036"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#ad077898da1668be20c85ec881a673c2e">00036</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#ad077898da1668be20c85ec881a673c2e">$m_int_COL_ID</a> = null;
<a name="l00037"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#a9ae7b097d8f2b5971a0d5a6ceb265e72">00037</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#a9ae7b097d8f2b5971a0d5a6ceb265e72">$m_int_COL_UserID</a> = null;
<a name="l00038"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#a29a154e2d5ffb02461c35e9c6bdbf9d7">00038</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#a29a154e2d5ffb02461c35e9c6bdbf9d7">$m_int_COL_Query</a> = null;
<a name="l00039"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#ad71386307397debba246767fa5920b03">00039</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#ad71386307397debba246767fa5920b03">$m_int_COL_QueryTitle</a> = NULL;
<a name="l00040"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#ab5c75d37ac4b2d72c909c0d0b80a4d54">00040</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#ab5c75d37ac4b2d72c909c0d0b80a4d54">$m_int_COL_SourceID</a> = NULL;
<a name="l00041"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#aa8e9dee4eb328edeb269530af421e84b">00041</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#aa8e9dee4eb328edeb269530af421e84b">$m_int_COL_LastRun</a> = null;
<a name="l00042"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#abfe7b03d336e4f794424d69f5d595ff7">00042</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#abfe7b03d336e4f794424d69f5d595ff7">$m_int_COL_NextRun</a> = null;
<a name="l00043"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#abd0dfe9a9e4fc1ca5cbeeed39c360fd6">00043</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#abd0dfe9a9e4fc1ca5cbeeed39c360fd6">$m_int_COL_Update</a> = null;
<a name="l00044"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#a2a651c981bedd1322fed496cc4d4c3fe">00044</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#a2a651c981bedd1322fed496cc4d4c3fe">$m_int_COL_Hour</a> = null;
<a name="l00045"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#a61c23df0dd473c7a364fa36b24cefb2a">00045</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#a61c23df0dd473c7a364fa36b24cefb2a">$m_int_COL_Day</a> = null;
<a name="l00046"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#a1b0e056ea1d8adde910e799607aa16f3">00046</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#a1b0e056ea1d8adde910e799607aa16f3">$m_int_COL_DayWeek</a> = null;
<a name="l00047"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#ab7508a4809fc4b2e2525f361d9b6f3d3">00047</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#ab7508a4809fc4b2e2525f361d9b6f3d3">$m_int_COL_Month</a> = null;
<a name="l00048"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#a0206964c3f51841b7da5368120ac5263">00048</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#a0206964c3f51841b7da5368120ac5263">$m_int_COL_Max</a> = null;
<a name="l00049"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#a68187d50399ce5f8cc47c46011d631c3">00049</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#a68187d50399ce5f8cc47c46011d631c3">$m_int_COL_Schedule</a> = null;
<a name="l00057"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#a095c5d389db211932136b53f25f39685">00057</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#a095c5d389db211932136b53f25f39685" title="This constructor sets all the required column data.">__construct</a>()
<a name="l00058"></a>00058                 {
<a name="l00059"></a>00059                         $this-&gt;m_str_TableName = <span class="stringliteral">&quot;Saved_Queries&quot;</span>;
<a name="l00060"></a>00060                         $this-&gt;set_Engine(self::C_STR_ENGINE_INNODB);
<a name="l00061"></a>00061 
<a name="l00062"></a>00062                         <span class="comment">//Create Column Objects</span>
<a name="l00063"></a>00063                         $obj_COL_ID = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;id&quot;</span>);
<a name="l00064"></a>00064                         $obj_COL_ID-&gt;set_Length(36);
<a name="l00065"></a>00065                         $obj_COL_ID-&gt;set_Index(abs_Column::c_int_INDEX_PRIMARY);
<a name="l00066"></a>00066                         $obj_COL_ID-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the ID of users.&quot;</span>);
<a name="l00067"></a>00067                         $obj_COL_ID-&gt;set_Editable(<span class="keyword">false</span>);
<a name="l00068"></a>00068                         $obj_COL_ID-&gt;set_Label(<span class="stringliteral">&quot;ID&quot;</span>);
<a name="l00069"></a>00069 
<a name="l00070"></a>00070                         $obj_COL_UserID = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;user_id&quot;</span>);
<a name="l00071"></a>00071                         $obj_COL_UserID-&gt;set_Length(36);
<a name="l00072"></a>00072                         $obj_COL_UserID-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the User GUID.&quot;</span>);
<a name="l00073"></a>00073                         $obj_COL_UserID-&gt;set_Label(<span class="stringliteral">&quot;User GUID&quot;</span>);
<a name="l00074"></a>00074 
<a name="l00075"></a>00075                         $obj_COL_SourceID = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;source_id&quot;</span>);
<a name="l00076"></a>00076                         $obj_COL_SourceID-&gt;set_Length(36);
<a name="l00077"></a>00077                         $obj_COL_SourceID-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the Source GUID.&quot;</span>);
<a name="l00078"></a>00078                         $obj_COL_SourceID-&gt;set_Label(<span class="stringliteral">&quot;Source GUID&quot;</span>);
<a name="l00079"></a>00079 
<a name="l00080"></a>00080                         $obj_COL_QueryTitle = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;q_title&quot;</span>);
<a name="l00081"></a>00081                         $obj_COL_QueryTitle-&gt;set_Length(255);
<a name="l00082"></a>00082                         $obj_COL_QueryTitle-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the name of the Query the user wishes to save.&quot;</span>);
<a name="l00083"></a>00083                         $obj_COL_QueryTitle-&gt;set_Label(<span class="stringliteral">&quot;Query Title&quot;</span>);
<a name="l00084"></a>00084 
<a name="l00085"></a>00085                         $obj_COL_QueryString = <span class="keyword">new</span> cColText(<span class="stringliteral">&quot;q_string&quot;</span>);
<a name="l00086"></a>00086                         $obj_COL_QueryString-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the Query the user wishes to save.&quot;</span>);
<a name="l00087"></a>00087                         $obj_COL_QueryString-&gt;set_Label(<span class="stringliteral">&quot;Query String&quot;</span>);
<a name="l00088"></a>00088 
<a name="l00089"></a>00089                         $obj_COL_LastRun = <span class="keyword">new</span> cColDateTime(<span class="stringliteral">&quot;last_run&quot;</span>);
<a name="l00090"></a>00090                         $obj_COL_LastRun-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the last run time.&quot;</span>);
<a name="l00091"></a>00091                         $obj_COL_LastRun-&gt;set_Label(<span class="stringliteral">&quot;Last Run&quot;</span>);
<a name="l00092"></a>00092 
<a name="l00093"></a>00093                         $obj_COL_NextRun = <span class="keyword">new</span> cColDateTime(<span class="stringliteral">&quot;next_run&quot;</span>);
<a name="l00094"></a>00094                         $obj_COL_NextRun-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the next run time.&quot;</span>);
<a name="l00095"></a>00095                         $obj_COL_NextRun-&gt;set_Label(<span class="stringliteral">&quot;Next Run&quot;</span>);
<a name="l00096"></a>00096 
<a name="l00097"></a>00097                         $obj_COL_Update = <span class="keyword">new</span> cColDateTime(<span class="stringliteral">&quot;update&quot;</span>);
<a name="l00098"></a>00098                         $obj_COL_Update-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the last updated time of saved query.&quot;</span>);
<a name="l00099"></a>00099                         $obj_COL_Update-&gt;set_Label(<span class="stringliteral">&quot;Update&quot;</span>);
<a name="l00100"></a>00100 
<a name="l00101"></a>00101                         $obj_COL_THour = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;t_hour&quot;</span>);
<a name="l00102"></a>00102                         $obj_COL_THour-&gt;set_Length(100);
<a name="l00103"></a>00103                         $obj_COL_THour-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the update hour.&quot;</span>);
<a name="l00104"></a>00104                         $obj_COL_THour-&gt;set_Label(<span class="stringliteral">&quot;Hour&quot;</span>);
<a name="l00105"></a>00105 
<a name="l00106"></a>00106                         $obj_COL_TDay = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;t_day&quot;</span>);
<a name="l00107"></a>00107                         $obj_COL_TDay-&gt;set_Length(13);
<a name="l00108"></a>00108                         $obj_COL_TDay-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the update day.&quot;</span>);
<a name="l00109"></a>00109                         $obj_COL_TDay-&gt;set_Label(<span class="stringliteral">&quot;Day&quot;</span>);
<a name="l00110"></a>00110 
<a name="l00111"></a>00111                         $obj_COL_TDayWeek = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;t_dayofweek&quot;</span>);
<a name="l00112"></a>00112                         $obj_COL_TDayWeek-&gt;set_Length(13);
<a name="l00113"></a>00113                         $obj_COL_TDayWeek-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the update day of the week.&quot;</span>);
<a name="l00114"></a>00114                         $obj_COL_TDayWeek-&gt;set_Label(<span class="stringliteral">&quot;Day of the week&quot;</span>);
<a name="l00115"></a>00115 
<a name="l00116"></a>00116                         $obj_COL_TMonth = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;t_month&quot;</span>);
<a name="l00117"></a>00117                         $obj_COL_TMonth-&gt;set_Length(4);
<a name="l00118"></a>00118                         $obj_COL_TMonth-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the update month.&quot;</span>);
<a name="l00119"></a>00119                         $obj_COL_TMonth-&gt;set_Label(<span class="stringliteral">&quot;Month&quot;</span>);
<a name="l00120"></a>00120 
<a name="l00121"></a>00121                         $obj_COL_Max = <span class="keyword">new</span> cColSmallInt(<span class="stringliteral">&quot;max&quot;</span>);
<a name="l00122"></a>00122                         $obj_COL_Max-&gt;set_Length(6);
<a name="l00123"></a>00123                         $obj_COL_Max-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the max return results.&quot;</span>);
<a name="l00124"></a>00124                         $obj_COL_Max-&gt;set_Label(<span class="stringliteral">&quot;Max Return&quot;</span>);
<a name="l00125"></a>00125 
<a name="l00126"></a>00126                         $obj_COL_Schedule = <span class="keyword">new</span> cColTinyInt(<span class="stringliteral">&quot;scheduled&quot;</span>);
<a name="l00127"></a>00127                         $obj_COL_Schedule-&gt;set_Length(1);
<a name="l00128"></a>00128                         $obj_COL_Schedule-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the scheduled bool check.&quot;</span>);
<a name="l00129"></a>00129                         $obj_COL_Schedule-&gt;set_Label(<span class="stringliteral">&quot;Scheduled&quot;</span>);
<a name="l00130"></a>00130 
<a name="l00131"></a>00131                         <span class="comment">//Set up connection</span>
<a name="l00132"></a>00132                         $this-&gt;m_obj_Connection = <span class="keyword">new</span> cConnection(<span class="stringliteral">&quot;AmpleHarvest&quot;</span>, <span class="stringliteral">&quot;admin&quot;</span>);
<a name="l00133"></a>00133 
<a name="l00134"></a>00134                         <span class="comment">//Activate all Debug options</span>
<a name="l00135"></a>00135                         $this-&gt;m_obj_Connection-&gt;set_DebugLevel(cLog_Connection_Debug::c_int_LEVEL_HIDDEN);
<a name="l00136"></a>00136                         $this-&gt;m_obj_Connection-&gt;set_LogLevel(cLog_Connection::c_int_LEVEL_BASIC);
<a name="l00137"></a>00137                         <span class="comment">//                      $this-&gt;m_obj_Connection-&gt;activate_Logging();</span>
<a name="l00138"></a>00138                         <span class="comment">//                      $this-&gt;m_obj_Connection-&gt;activate_LogDebug();</span>
<a name="l00139"></a>00139                         <span class="comment">//                      $this-&gt;m_obj_Connection-&gt;activate_ScreenDebug();</span>
<a name="l00140"></a>00140 
<a name="l00141"></a>00141                         $this-&gt;m_int_COL_ID = $this-&gt;add_Column($obj_COL_ID);
<a name="l00142"></a>00142                         $this-&gt;m_int_COL_UserID = $this-&gt;add_Column($obj_COL_UserID);
<a name="l00143"></a>00143                         $this-&gt;m_int_COL_SourceID = $this-&gt;add_Column($obj_COL_SourceID);
<a name="l00144"></a>00144                         $this-&gt;m_int_COL_QueryTitle = $this-&gt;add_Column($obj_COL_QueryTitle);
<a name="l00145"></a>00145                         $this-&gt;m_int_COL_Query = $this-&gt;add_Column($obj_COL_QueryString);
<a name="l00146"></a>00146                         $this-&gt;m_int_COL_LastRun = $this-&gt;add_Column($obj_COL_LastRun);
<a name="l00147"></a>00147                         $this-&gt;m_int_COL_NextRun = $this-&gt;add_Column($obj_COL_NextRun);
<a name="l00148"></a>00148                         $this-&gt;m_int_COL_Update = $this-&gt;add_Column($obj_COL_Update);
<a name="l00149"></a>00149                         $this-&gt;m_int_COL_Hour = $this-&gt;add_Column($obj_COL_THour);
<a name="l00150"></a>00150                         $this-&gt;m_int_COL_Day = $this-&gt;add_Column($obj_COL_TDay);
<a name="l00151"></a>00151                         $this-&gt;m_int_COL_DayWeek = $this-&gt;add_Column($obj_COL_TDayWeek);
<a name="l00152"></a>00152                         $this-&gt;m_int_COL_Month = $this-&gt;add_Column($obj_COL_TMonth);
<a name="l00153"></a>00153                         $this-&gt;m_int_COL_Max = $this-&gt;add_Column($obj_COL_Max);
<a name="l00154"></a>00154                         $this-&gt;m_int_COL_Schedule = $this-&gt;add_Column($obj_COL_Schedule);
<a name="l00155"></a>00155                 }
<a name="l00156"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#a911a49525944199fe5f4cdbdc3d9e562">00156</a>                 <span class="keyword">static</span> <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#a911a49525944199fe5f4cdbdc3d9e562">encode</a>($str_Data)
<a name="l00157"></a>00157                 {
<a name="l00158"></a>00158                         $str_Data = base64_encode(serialize($str_Data));
<a name="l00159"></a>00159                         <span class="keywordflow">return</span> $str_Data;
<a name="l00160"></a>00160                 }
<a name="l00161"></a>00161 
<a name="l00162"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#a1255c78f6d7895ed7f454ff21c065118">00162</a>                 <span class="keyword">static</span> <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#a1255c78f6d7895ed7f454ff21c065118">decode</a>($str_Data)
<a name="l00163"></a>00163                 {
<a name="l00164"></a>00164                         $str_Data = unserialize(base64_decode($str_Data));
<a name="l00165"></a>00165                         <span class="keywordflow">return</span> $str_Data;
<a name="l00166"></a>00166                 }
<a name="l00170"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#a42e7dcfc7851c0dedcafb63968ffbc02">00170</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#a42e7dcfc7851c0dedcafb63968ffbc02" title="Saves Information to the Database.">save_Data2DB</a>()
<a name="l00171"></a>00171                 {
<a name="l00172"></a>00172                         <span class="keywordflow">if</span> (!$this-&gt;get_max())
<a name="l00173"></a>00173                         {
<a name="l00174"></a>00174                                 $this-&gt;set_max(self::C_INT_DEFAULT_RESULTS_RETURNED);
<a name="l00175"></a>00175                         }
<a name="l00176"></a>00176                         <span class="keywordflow">else</span>
<a name="l00177"></a>00177                         {
<a name="l00178"></a>00178                                 <span class="keywordflow">if</span> (($this-&gt;get_max() &lt; 1) || ($this-&gt;get_max() &gt; self::C_INT_MAX_RESULTS_RETURNED))
<a name="l00179"></a>00179                                 {
<a name="l00180"></a>00180                                         $this-&gt;set_max(self::C_INT_MAX_RESULTS_RETURNED);
<a name="l00181"></a>00181                                 }
<a name="l00182"></a>00182                         }
<a name="l00183"></a>00183 
<a name="l00184"></a>00184                         $this-&gt;set_ColumnValue($this-&gt;m_int_COL_Update, date(<span class="stringliteral">&quot;Y/m/d H:i:s&quot;</span>));
<a name="l00185"></a>00185 
<a name="l00186"></a>00186                         <span class="keywordflow">if</span> ($this-&gt;<a class="code" href="classc_t_a_b_l_e___saved___queries.html#acbb490790d87e7fdee9fc1d53354947b" title="Returns if the id is a valid and existing ID.">validate_ID</a>($this-&gt;get_id()))
<a name="l00187"></a>00187                         {
<a name="l00188"></a>00188                                 <span class="keywordflow">return</span> $this-&gt;<a class="code" href="classc_t_a_b_l_e___saved___queries.html#a8bf8fc7182a41039d94dd975a0b40229" title="This function is used to update data that is already in the database.">update_Data2DB</a>();
<a name="l00189"></a>00189                         }
<a name="l00190"></a>00190                         <span class="keywordflow">else</span>
<a name="l00191"></a>00191                         {
<a name="l00192"></a>00192                                 <span class="keywordflow">return</span> $this-&gt;<a class="code" href="classc_t_a_b_l_e___saved___queries.html#a2055504e90b0a396c1de85aaad0c80ab" title="This function is used to insert Data into the database.">insert_Data2DB</a>();
<a name="l00193"></a>00193                         }
<a name="l00194"></a>00194 
<a name="l00195"></a>00195                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00196"></a>00196                 }
<a name="l00200"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#a8bf8fc7182a41039d94dd975a0b40229">00200</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#a8bf8fc7182a41039d94dd975a0b40229" title="This function is used to update data that is already in the database.">update_Data2DB</a>()
<a name="l00201"></a>00201                 {
<a name="l00202"></a>00202                         $this-&gt;clear_Update();
<a name="l00203"></a>00203                         $this-&gt;add_ColumnQuery($this-&gt;m_int_COL_ID, $this-&gt;get_id());
<a name="l00204"></a>00204 
<a name="l00205"></a>00205                         <span class="keywordflow">return</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#a8bf8fc7182a41039d94dd975a0b40229" title="This function is used to update data that is already in the database.">parent::update_Data2DB</a>();
<a name="l00206"></a>00206                 }
<a name="l00210"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#a2055504e90b0a396c1de85aaad0c80ab">00210</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#a2055504e90b0a396c1de85aaad0c80ab" title="This function is used to insert Data into the database.">insert_Data2DB</a>()
<a name="l00211"></a>00211                 {
<a name="l00212"></a>00212                         $this-&gt;set_id($this-&gt;create_GUID());
<a name="l00213"></a>00213 
<a name="l00214"></a>00214                         <span class="keywordflow">return</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#a2055504e90b0a396c1de85aaad0c80ab" title="This function is used to insert Data into the database.">parent::insert_Data2DB</a>();
<a name="l00215"></a>00215                 }
<a name="l00216"></a>00216 
<a name="l00222"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#a41f8052cfb869dd6d1dfb2cb33e15a07">00222</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#a41f8052cfb869dd6d1dfb2cb33e15a07" title="This function is used to delete Data from the database.">delete_Query</a>(<a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>)
<a name="l00223"></a>00223                 {
<a name="l00224"></a>00224                         $this-&gt;clear_Query();
<a name="l00225"></a>00225                         $this-&gt;add_ColumnQuery($this-&gt;m_int_COL_ID, <a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>);
<a name="l00226"></a>00226                         <span class="keywordflow">if</span> ($this-&gt;do_Delete() &lt; 0)
<a name="l00227"></a>00227                         {
<a name="l00228"></a>00228                                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00229"></a>00229                         }
<a name="l00230"></a>00230                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00231"></a>00231                 }
<a name="l00232"></a>00232 
<a name="l00238"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#acbb490790d87e7fdee9fc1d53354947b">00238</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#acbb490790d87e7fdee9fc1d53354947b" title="Returns if the id is a valid and existing ID.">validate_ID</a>(<a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>)
<a name="l00239"></a>00239                 {
<a name="l00240"></a>00240                         <span class="comment">// ensure that there is an ID passed and that it is a valid GUID</span>
<a name="l00241"></a>00241                         <span class="keywordflow">if</span> (!empty(<a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>) &amp;&amp; preg_match(self::c_REG_GUID_VALID, <a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>))
<a name="l00242"></a>00242                         {
<a name="l00243"></a>00243                                 $this-&gt;clear_Query();
<a name="l00244"></a>00244                                 $this-&gt;add_ColumnQuery($this-&gt;m_int_COL_ID, <a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>);
<a name="l00245"></a>00245                                 <span class="keywordflow">if</span> ($this-&gt;do_Search() &gt; 0)
<a name="l00246"></a>00246                                 {
<a name="l00247"></a>00247                                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00248"></a>00248                                 }
<a name="l00249"></a>00249                         }
<a name="l00250"></a>00250                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00251"></a>00251                 }
<a name="l00252"></a>00252 
<a name="l00258"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#a7f7d36d28f818d0d64ae30da6f170a0a">00258</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#a7f7d36d28f818d0d64ae30da6f170a0a" title="Loads information into object from Database based on ID passed.">load_DataFromID</a>(<a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>)
<a name="l00259"></a>00259                 {
<a name="l00260"></a>00260                         $this-&gt;clear();
<a name="l00261"></a>00261 
<a name="l00262"></a>00262                         <span class="keywordflow">if</span> (!empty(<a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>) &amp;&amp; preg_match(self::c_REG_GUID_VALID, <a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>))
<a name="l00263"></a>00263                         {
<a name="l00264"></a>00264                                 $this-&gt;clear_Query();
<a name="l00265"></a>00265                                 $this-&gt;add_ColumnQuery($this-&gt;m_int_COL_ID, <a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>);
<a name="l00266"></a>00266                                 <span class="keywordflow">if</span> ($this-&gt;do_Search() &gt; 0)
<a name="l00267"></a>00267                                 {
<a name="l00268"></a>00268                                         $obj_RS = $this-&gt;get_ResultSet();
<a name="l00269"></a>00269                                         <span class="keywordflow">if</span> ($obj_RS[0])
<a name="l00270"></a>00270                                         {
<a name="l00271"></a>00271                                                 $this-&gt;load_DataFromArray($obj_RS[0]);
<a name="l00272"></a>00272                                                 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00273"></a>00273                                         }
<a name="l00274"></a>00274                                 }
<a name="l00275"></a>00275                         }
<a name="l00276"></a>00276                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00277"></a>00277                 }
<a name="l00278"></a>00278 
<a name="l00285"></a><a class="code" href="classc_t_a_b_l_e___saved___queries.html#a1e6431497e0c54a3a7ea42d0c37201d3">00285</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___saved___queries.html#a1e6431497e0c54a3a7ea42d0c37201d3" title="Enter description here ...">getSourceName</a>($source_ID)
<a name="l00286"></a>00286                 {
<a name="l00287"></a>00287                         $t_source_name = <span class="stringliteral">&#39;&#39;</span>;
<a name="l00288"></a>00288                         <span class="keywordflow">switch</span> ($source_ID)
<a name="l00289"></a>00289                         {
<a name="l00290"></a>00290                                 <span class="keywordflow">case</span> code\cConfig::C_STR_SOURCE_REAPER:
<a name="l00291"></a>00291                                         $t_source_name = <span class="stringliteral">&#39;Reaper&#39;</span>;
<a name="l00292"></a>00292                                         <span class="keywordflow">break</span>;
<a name="l00293"></a>00293                                 <span class="keywordflow">case</span> code\cConfig::C_STR_SOURCE_OCTOBERSKY:
<a name="l00294"></a>00294                                         $t_source_name = <span class="stringliteral">&#39;OctoberSky&#39;</span>;
<a name="l00295"></a>00295                                         <span class="keywordflow">break</span>;
<a name="l00296"></a>00296                                 <span class="keywordflow">case</span> code\cConfig::C_STR_SOURCE_GROUNDEFFECT:
<a name="l00297"></a>00297                                         $t_source_name = <span class="stringliteral">&#39;GroundEffect&#39;</span>;
<a name="l00298"></a>00298                                         <span class="keywordflow">break</span>;
<a name="l00299"></a>00299                         }
<a name="l00300"></a>00300                         <span class="keywordflow">return</span> $t_source_name;
<a name="l00301"></a>00301                 }
<a name="l00302"></a>00302         }
<a name="l00303"></a>00303 ?&gt;
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="c_t_a_b_l_e___saved___queries_8php.html">cTABLE_Saved_Queries.php</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">Generated on Mon Jan 23 2012 13:34:20 for AmpleHarvest by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
